/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Modelo;

import java.io.Serializable;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Administrador
 */
@Entity
@Table(name = "registro")
@NamedQueries({@NamedQuery(name = "Registro.findAll", query = "SELECT r FROM Registro r"), @NamedQuery(name = "Registro.findByIdpregunta", query = "SELECT r FROM Registro r WHERE r.registroPK.idpregunta = :idpregunta"), @NamedQuery(name = "Registro.findByIdetiqueta", query = "SELECT r FROM Registro r WHERE r.registroPK.idetiqueta = :idetiqueta"), @NamedQuery(name = "Registro.findByIdrespuesta", query = "SELECT r FROM Registro r WHERE r.registroPK.idrespuesta = :idrespuesta")})
public class Registro implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected RegistroPK registroPK;

    public Registro() {
    }

    public Registro(RegistroPK registroPK) {
        this.registroPK = registroPK;
    }

    public Registro(long idpregunta, long idetiqueta, long idrespuesta) {
        this.registroPK = new RegistroPK(idpregunta, idetiqueta, idrespuesta);
    }

  

   
    public RegistroPK getRegistroPK() {
        return registroPK;
    }

    public void setRegistroPK(RegistroPK registroPK) {
        this.registroPK = registroPK;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (registroPK != null ? registroPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Registro)) {
            return false;
        }
        Registro other = (Registro) object;
        if ((this.registroPK == null && other.registroPK != null) || (this.registroPK != null && !this.registroPK.equals(other.registroPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "pack.Registro[registroPK=" + registroPK + "]";
    }

    

}
